package yf.mall.vo.down;


import lombok.Data;
import java.util.Date;
import com.alibaba.excel.annotation.*;
import java.io.Serializable;



import yf.mall.entity.AppMaterialEntity;
import yf.mall.vo.AppMaterialVo;

                import yf.mall.enums.AppMaterialFileTypeEnum;
                        
/**
 * 素材信息表实体
 * 表名 app_material
 *
 * 
 * 
 * @date Tue Jul 18 14:30:26 CST 2023
 */
@Data
public class AppMaterialDown implements Serializable {
    @ExcelIgnore
    private static final long serialVersionUID = 1L;

                        //主键，素材ID
            @ExcelProperty("主键，素材ID")
            private Long id;
        
                        //素材标题
            @ExcelProperty("素材标题")
            private String title;
        
                        //IMG-素材封面
            @ExcelProperty("IMG-素材封面")
            private String cover;
        
                        //ENUM-素材类型：视频、图片、音频、文本:"视频-1","图片-2","音频-3","文本-0"
            @ExcelIgnore
            private Integer fileType;
                        @ExcelProperty("素材类型：视频、图片、音频、文本")
            private String fileTypeStr;
        
                        //素材分类，具体参考材料分类接口
            @ExcelProperty("素材分类，具体参考材料分类接口")
            private Long type;
        
                        //发布时间
            @ExcelProperty("发布时间")
            private Date publishTime;
        
                        //素材大小
            @ExcelProperty("素材大小")
            private Integer size;
        
                        //视频素材时长
            @ExcelProperty("视频素材时长")
            private Integer times;
        
                        //素材地址
            @ExcelProperty("素材地址")
            private String url;
        
                        //素材内容
            @ExcelProperty("素材内容")
            private String content;
        
    
    public AppMaterialDown() {

    }

    public AppMaterialDown(AppMaterialVo vo) {
        AppMaterialEntity entity = vo.getEntity();
                                    this.setId(entity.getId());
            
                                    this.setTitle(entity.getTitle());
            
                                    this.setCover(entity.getCover());
            
                                    this.setFileType(entity.getFileType());
                if(entity.getFileType()!=null){
                    this.setFileTypeStr( AppMaterialFileTypeEnum.indexOf(entity.getFileType()));
                }
            
                                    this.setType(entity.getType());
            
                                    this.setPublishTime(entity.getPublishTime());
            
                                    this.setSize(entity.getSize());
            
                                    this.setTimes(entity.getTimes());
            
                                    this.setUrl(entity.getUrl());
            
                                    this.setContent(entity.getContent());
            
            }


}
